<#-- <#assign s=JspTaglibs["/struts-tags"]/>-->

<!-- pageNavigationTemplate begin -->
<!-- name="action" value="" -->
<!-- name="curIdx" value="0" -->
<!-- name="pageCount" value="10" -->
<!-- name="recordCount" value="100" -->
<script type="text/javascript">
    function pageNavigationTemplate_keydown(){
        if(event.keyCode==13){
          
           self.open("user.action?pageIdx="+(event.currentTarget.value-1),"_self");
        }
    }
</script>
<#--
kinzhang:${parameters.recordCount/parameters.pageCount}
parameters:${parameters.curIdx}
-->
<#assign pageNum = parameters.recordCount/parameters.pageCount >

<#assign pageNum = stack.findValue("@java.lang.Math@ceil(${pageNum})") >

<#if pageNum < 1 >
    <#assign pageNum = 1 >
</#if>
<#assign pageNavDis = 5 >

<#if (parameters.curIdx - 5 >= 0) >
    <#assign pageNavBegin = parameters.curIdx - 5 >
<#else>
    <#assign pageNavBegin = 0 >
</#if>

<#assign pageNavEnd = parameters.curIdx + 5 >
<#if (pageNavEnd >= pageNum) >
    <#assign pageNavEnd = pageNum - 1 >
</#if>

<#assign idxParamName = parameters.idxParamName >
<#assign curIdx = parameters.curIdx >



<#if parameters.recordCount==0 >
    
<#else>
    <span class=ipagenav>
        <#if parameters.curIdx==0 >
            <span>首页</span>
            &nbsp;
            <span>前一页</span>
        <#else>
            <a href="${parameters.action}?pageIdx=0">首页</a>
            <a href="${parameters.action}?pageIdx=${curIdx-1}">前一页</a>
        </#if>
        &nbsp;&nbsp;
        <#list pageNavBegin..pageNavEnd as i > 
            <#if curIdx == i>
                [${i+1}]
            <#else>
                <a href="${parameters.action}?pageIdx=${i}">${i+1}</a>
            </#if>
        </#list>
        &nbsp;&nbsp;
        <#if (parameters.curIdx >= (pageNum-1)) >
            <span>后一页</span>
            &nbsp;
            <span>尾页</span>
        <#else>
            <a href="${parameters.action}?pageIdx=${curIdx+1}">后一页</a>
            &nbsp;
            <a href="${parameters.action}?pageIdx=${pageNum-1}" title="尾页">尾页</a>
        </#if>
        &nbsp;&nbsp;&nbsp;跳到
        <input type='text' id='thepage' size='3' class="admTextSeven" onkeydown='pageNavigationTemplate_keydown()' />页
        &nbsp;&nbsp;&nbsp;共${parameters.recordCount}个${pageNum}页
    </span>
</#if>

<!-- pageNavigationTemplate end -->
